Imports org.model.lib.db


Public Class CandidateCodeGeneratorFactory

    Property counterByCountry As Dictionary(Of String, Integer) = _
            New Dictionary(Of String, Integer)

    Function getCandidateCodeGenerator(ByVal pclass As PeriodClass, _
                                       ByVal student As Student) As ICandidateCodeGenerator

        Dim ret As ICandidateCodeGenerator

        If pclass.Period.DiplomaSuperTypeId = EnumDiplomaSuperTypes.PVAK Then
            ret = New PVAKCandidateCodeGenerator

        ElseIf pclass.Period.DiplomaSuperTypeId = EnumDiplomaSuperTypes.CFA Then
            ret = New CFACandidateCodeGenerator

        Else
            ret = New DASCandidateCodeGenerator
        End If

        ret.student = student
        ret.periodClass = pclass

        Return ret

    End Function

End Class
